#include <iostream>
#include <string>

//代理模式

//租房类
class RentHouse
{
public:
  virtual void rentHouse() = 0; //纯虚函数
};

//房东类
class Landlard : public RentHouse
{
public:
  //重写
  void rentHouse() override
  {
    std::cout << "出售房子\n";
  }
};

class Agent : public RentHouse 
{
public:
  void rentHouse() override
  {
    std::cout << "发布出租信息\n";
    std::cout << "找寻租客\n";
    _landlard.rentHouse();
    std::cout << "租房售后\n";
  }
protected:
  Landlard _landlard;
};

int main()
{
  Agent agent;
  agent.rentHouse();

  return 0;
}
